#ifndef __MEMORY_MANAGER_H__
#define __MEMORY_MANAGER_H__

#include "cocos2d.h"
#include "../CoreMacro.h"
#include "../StaticArray/LStaticArray.h"

NS_CC_CORE_BEGIN

class MemoryManagerDelegate
{
public:
	MemoryManagerDelegate( );

	virtual ~MemoryManagerDelegate( );
};

/*
	This class use to handle the release of singleton classes

	NOTE : to use this class , your singleton class MUST inheritance from MemoryManagerDelegate base class
*/
class MemoryManager
{
public:
	MemoryManager( );
	virtual ~MemoryManager( );

	static		MemoryManager*			sharedMemoryManager		( );

	void		add						( MemoryManagerDelegate* pObj );

	static void		purge				( );

private:
	LStaticArray<MemoryManagerDelegate>* m_pListMemoryObj;
};





NS_CC_CORE_END

#endif